﻿//
// Copyright 2008-2011 by Burt Harris
// Licensed under the Microsoft Public License (Ms-PL)
// See: http://www.codeplex.com/yaml/license
//

using System;
using System.ComponentModel;
using System.Diagnostics.Contracts;
using System.Runtime.Serialization;

namespace YaTools.Yaml
{
    public abstract class DynamicSerializationSurrogate : ISerializationSurrogate
    {
        #region ISerializationSurrogate Members

        void ISerializationSurrogate.GetObjectData(object obj, SerializationInfo info, StreamingContext context)
        {
            throw new NotImplementedException();
        }

        object ISerializationSurrogate.SetObjectData(object obj, SerializationInfo info, StreamingContext context,
                                    ISurrogateSelector selector)
        {
            throw new NotImplementedException();
        }

        #endregion

        public abstract PropertyDescriptorCollection GetSerializableProperties(Type type);

        public virtual PropertyDescriptorCollection GetSerializableProperties(object o)
        {
            Contract.Requires(o != null);
            return GetSerializableProperties(o.GetType());
        }
    }
}